<div id="content">
    
    <div class="response">
        <? if(empty($subitems)){ ?>
        <span class="warning">
            <div style="margin-bottom:10px">
                You're about to permanently delete a Category.
            </div>
            <a class="button" href="<?=site_url($controller.'/confirm_removal/'.$item["id_Categories"])?>">CONFIRM DELETION</a>
            <a class="button" href="<?=site_url($controller)?>">CANCEL</a>
        </span>
        <? } else { ?>
        <span class="error">
            The Category you're attempting to delete has subcategories or products.<br />
            Please delete them or move them to a different category before deleting this category.<br />
            Warning: Some of the items shown might not be visible in the front-end because they are inactive, pending approval or empty.
        </span>                                                                                         
        <? } ?>
    </div>   

    <div class="preview">   

        <? $this->load->view('admin/previews/category_item_detail', array("item" => $item))?>

    <? //show products or subcategories

        if (!empty($subitems)) { 

        $i=1;
        foreach($subitems as $subitem){ 
        ?>

            <? if (is_int(($i+2)/3)){ ?>
                <div class="summarycontainer">
            <? } ?> 
            
                <div class="contain<? if (is_int($i/3)) echo 'right'?>">
                <? $this->load->view('admin/previews/product_item_list', array("item" => $subitem)) ?>
                </div>                 

            <? if ( (is_int($i/3)) || ($i==count($subitems)) ){ ?>
                </div>
            <? } ?> 
        <? 
            $i++;
        } 
    } 
    ?>

    </div>


</div>